15 research outputs found

    Automatic Termination Analysis of Programs Containing Arithmetic Predicates

    Full text link
    For logic programs with arithmetic predicates, showing termination is not easy, since the usual order for the integers is not well-founded. A new method, easily incorporated in the TermiLog system for automatic termination analysis, is presented for showing termination in this case. The method consists of the following steps: First, a finite abstract domain for representing the range of integers is deduced automatically. Based on this abstraction, abstract interpretation is applied to the program. The result is a finite number of atoms abstracting answers to queries which are used to extend the technique of query-mapping pairs. For each query-mapping pair that is potentially non-terminating, a bounded (integer-valued) termination function is guessed. If traversing the pair decreases the value of the termination function, then termination is established. Simple functions often suffice for each query-mapping pair, and that gives our approach an edge over the classical approach of using a single termination function for all loops, which must inevitably be more complicated and harder to guess automatically. It is worth noting that the termination of McCarthy's 91 function can be shown automatically using our method. In summary, the proposed approach is based on combining a finite abstraction of the integers with the technique of the query-mapping pairs, and is essentially capable of dividing a termination proof into several cases, such that a simple termination function suffices for each case. Consequently, the whole process of proving termination can be done automatically in the framework of TermiLog and similar systems.Comment: Appeared also in Electronic Notes in Computer Science vol. 3

    A General Framework for Automatic Termination Analysis of Logic Programs

    Full text link
    This paper describes a general framework for automatic termination analysis of logic programs, where we understand by ``termination'' the finitenes s of the LD-tree constructed for the program and a given query. A general property of mappings from a certain subset of the branches of an infinite LD-tree into a finite set is proved. From this result several termination theorems are derived, by using different finite sets. The first two are formulated for the predicate dependency and atom dependency graphs. Then a general result for the case of the query-mapping pairs relevant to a program is proved (cf. \cite{Sagiv,Lindenstrauss:Sagiv}). The correctness of the {\em TermiLog} system described in \cite{Lindenstrauss:Sagiv:Serebrenik} follows from it. In this system it is not possible to prove termination for programs involving arithmetic predicates, since the usual order for the integers is not well-founded. A new method, which can be easily incorporated in {\em TermiLog} or similar systems, is presented, which makes it possible to prove termination for programs involving arithmetic predicates. It is based on combining a finite abstraction of the integers with the technique of the query-mapping pairs, and is essentially capable of dividing a termination proof into several cases, such that a simple termination function suffices for each case. Finally several possible extensions are outlined

    Size-Change Termination, Monotonicity Constraints and Ranking Functions

    Full text link
    Size-Change Termination (SCT) is a method of proving program termination based on the impossibility of infinite descent. To this end we may use a program abstraction in which transitions are described by monotonicity constraints over (abstract) variables. When only constraints of the form x>y' and x>=y' are allowed, we have size-change graphs. Both theory and practice are now more evolved in this restricted framework then in the general framework of monotonicity constraints. This paper shows that it is possible to extend and adapt some theory from the domain of size-change graphs to the general case, thus complementing previous work on monotonicity constraints. In particular, we present precise decision procedures for termination; and we provide a procedure to construct explicit global ranking functions from monotonicity constraints in singly-exponential time, which is better than what has been published so far even for size-change graphs.Comment: revised version of September 2

    ABSTRACT AND-PARALLEL MACHINES

    No full text
    Several abstract models of fine-grained parallelism, suited to symbolic programming languages, are suggested. The first, the  and-parallel Turing machine, can be viewed as a generalization of the deterministic Turing machine in which the infinite tape is replaced by an infinite tree-like tape on which processors work in parallel. With this model one can express in a very natural way communication between processors, suspension, and synchronization.  There are examples in which the processing time is polylogarithmic in the size of the input while for a nondeterministicTuring machine that looks at its input the time must be at least of the order of magnitude of the size of the input.  Then a stronger model, the  parallel rewriting machine, is introduced. Transitions are formulated as rewrite rules, resulting in a machine that is much easier to program.  This also adds a `pointer capability' to the previous machine.  Since this machine gets the program in a form that reflects its meaning, problems of synchronization are easily handled - rewrite rules just cannot be applied before arguments reach the right form. In both models a processor can launch other processors on subcomputations, but processing at a parent node must wait for answers from all of its "children''. One can introduce more powerful models that contain the possibility of an interrupt - if the answer from one child (or several children) is sufficient to continue the computation at the parent, the computation started by the other children can and should be interrupted.  These  interrupt machines are much more powerful than the previous two, but it does not seem to be much more difficult to implement them.  Although the machines considered are very powerful - the parallel rewriting  machine can compute the permanent in polynomial time and the and-parallel Turing machine with interrupt can simulate a nondeterministic Turing machine and an alternating Turing machine - they can be seen as models of realistic machines if time and space are suitably restricted

    Automatic Termination Analysis of Logic Programs (with Detailed Experimental Results)

    No full text
    This paper describes a system implemented in SICStus Prolog for automatically checking left termination of logic programs. Given a program and query, the system answers either that the query terminates or that there may be non-termination. The system can use any norm of a wide family of norms. It can handle automatically most of the examples found in the literature on termination of logic programs, and about half of the programs in the benchmarks of [5]. The algorithm employed by the system consists of three main parts: instantiation analysis (i.e., rigidity analysis), constraint inference, and construction of the query-mapping pairs associated with the program and query. Each of these parts generalizes earlier work related to termination analysis

    Automatic Termination Analysis of Logic Programs

    No full text
    This paper describes a system implemented in SICStus Prolog for automatically checking left termination of logic programs. Given a program and query, the system answers either that the query terminates or that there may be non-termination. The system can use any norm of a wide family of norms. It can handle automatically most of the examples found in the literature on termination of logic programs, and about half of the programs in the benchmarks of [5]. The algorithm employed by the system consists of three main parts: instantiation analysis (i.e., rigidity analysis), constraint inference, and construction of the query-mapping pairs associated with the program and query. Each of these parts generalizes earlier work related to termination analysis. 1 Introduction Termination analysis of logic programs has been the focus of intensive research in recent years. Systems for automatic termination analysis are proposed, for example, in [15, 20, 22]. Methodologies and techniques for proving ..

    Average Time Analyses Related to Logic Programming

    No full text
    Logic programs are known to be amenable to parallelization. Our work is an attempt to quantify the magnitude of speed-up one can expect from parallel execution of a logic program. To make average case analysis tractable we look separately at two aspects of logic program execution: the "subgoaling" aspect, which involves trying to prove a goal by using matching to reduce it to other goals and finally to true, and the "goal reduction" aspect, involving full unification. In the first case we assume that the and-or tree determined by a goal can be constructed by matching only, and show---using the generating function approach of Flajolet--- that the average cost of evaluating such trees in parallel tends to a constant as the size tends to infinity, but that the same is true, though with a larger constant, for "clever" sequential evaluation. For the second aspect we use the generating function methods to obtain partial results about unification, which suggest that, although unification may..

    A Parallel Implementation of Equational Programming

    No full text
    A parallel implementation of rewriting and narrowing is described. This implementation is written in Flat Concurrent Prolog (FCP), but may be coded in any system in which processes are capable of creating other processes and communicating with each other. Running programs under the interpreter and using facilities provided by the FCP system, we obtain empirical evidence of parallel speed-up in support of theoretical predictions

    Automatic Termination Analysis of Programs Containing Arithmetic Predicates

    No full text
    For logic programs with arithmetic predicates, showing termination is not easy, since the usual order for the integers is not well-founded. A new method, easily incorporated in the TermiLog system for automatic termination analysis, is presented for showing termination in this case. The method consists of the following steps: First, a finite abstract domain for representing the range of integers is deduced automatically. Based on this abstraction, abstract interpretation is applied to the program. The result is a finite number of atoms abstracting answers to queries which are used to extend the technique of query-mapping pairs. For each query-mapping pair that is potentially non-terminating, a bounded (integer-valued) termination function is guessed. If traversing the pair decreases the value of the termination function, then termination is established. Simple functions often suffice for each query-mapping pair, and that gives our approach an edge over the classical approach of using a single termination function for all loops, which must inevitably be more complicated and harder to guess automatically. It is worth noting that the termination of McCarthy’s 91 function can be shown automatically using our method. In summary, the proposed approach is based on combining a finite abstraction of the integers with the technique of the query-mapping pairs, and is essentially capable of dividing a termination proof into several cases, such that a simple termination function suffices for each case. Consequently, the whole process of proving termination can be done automatically in the framework of TermiLog and similar systems

    A General Framework for Automatic Termination Analysis of Logic Programs?

    No full text
    This paper describes a general framework for automatic termination analysis of logic programs, where we understand by "termination" the finiteness of the LD-tree constructed for the program and a given query. A general property of mappings from a certain subset of the branches of an infinite LD-tree into a finite set is proved. From this result several termination theorems are derived, by using different finite sets. The first two are formulated for the predicate dependency and atom dependency graphs. Then a general result for the case of the query-mapping pairs relevant to a program is proved (cf. [29,21]). The correctness of the TermiLog system described in [22] follows from it. In this system it is not possible to prove termination for programs involving arithmetic predicates, since the usual order for the integers is not well-founded. A new method, which can be easily incorporated in TermiLog or similar systems, is presented, which makes it possible to prove termination for programs involving arithmetic predicates. It is based on combining a nite abstraction of the integers with the technique of the query-mapping pairs, and is essentially capable of dividing a termination proof into several cases, such that a simple termination function suffices for each case. Finally several possible extensions are outlined
    corecore